function getFile()
{
  if(!isset($_REQUEST['id'])){
    $this->setMessage('Nieprawidowe wywoanie.');
    return ACTION_FAILED;
  }
  
  $id = intval($_REQUEST['id']);
  
  $query = "SELECT Nazwa FROM files WHERE id = $id";

  if(!($result = $this->dbo->query($query)) || !($row = $result->fetch())){
    $this->setMessage('Brak wskazanego pliku.');
    return ACTION_FAILED;
  }
  
  $filename = $row[0];
  
  $fullfilepath = $this->filespath.$filename;
  
  if(!file_exists($fullfilepath)){
    $this->setMessage('Brak wskazanego pliku.');
    return ACTION_FAILED;
  }
  
  header('Content-Type: application/octet-stream');
  header('Content-Disposition: attachment; filename='.$filename);
  header('Content-Length: ' . filesize($fullfilepath));
  readfile($fullfilepath);
}